/**
 * 打印文本
 */
define(function (require, exports, module) {
    return function (text, title) {
        title = title || '';

        var screenWidth = window.screen.width;
        var screenHeight = window.screen.height;

        var mywindow = window.open('', title, 'height=0,width=0,top=' + screenHeight / 2 + ',left=' + screenWidth / 2);
        mywindow.document.write('<html><head><title>' + title + '</title>');
        /*optional stylesheet*/ //mywindow.document.write('<link rel="stylesheet" href="main.css" type="text/css" />');
        mywindow.document.write('</head><body >');
        mywindow.document.write(text);
        mywindow.document.write('</body></html>');

        mywindow.document.close(); // necessary for IE >= 10
        mywindow.focus(); // necessary for IE >= 10

        mywindow.print();
        mywindow.close();

        return true;
    };
});